package cn.gov.pbc.exam.dto;

import org.apache.commons.lang3.StringUtils;

import cn.gov.pbc.exam.common.ServerResponse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDto {
	
	private String user;
	
	private String dept;
	
	public ServerResponse<?> validate(){
		if(StringUtils.isBlank(this.user)) {
			return ServerResponse.createByErrorMessage("用户名错误");
		}
		if(StringUtils.isBlank(this.dept)) {
			return ServerResponse.createByErrorMessage("部门错误");
		}
		this.user = user.trim();
		this.dept = dept.trim();
		return ServerResponse.createBySuccess();
	}
}
